<template>
  <div style="display: flex; justify-content: flex-start; width: 100%">
    <Menu @on-select="ye">
      <MenuItem name="1"><Icon type="md-document" />用户列表</MenuItem>
      <MenuItem name="2"><Icon type="md-chatbubbles" />轮播管理</MenuItem>
      <MenuItem name="3"
        ><Icon type="ivu-icon ivu-icon-md-contacts" />分类信息</MenuItem>
      <MenuItem name="4"
        ><Icon type="ivu-icon ivu-icon-md-contacts" /> 资金流水</MenuItem>
      <MenuItem name="5"
        ><Icon type="ivu-icon ivu-icon-md-people" /> 优惠卷</MenuItem>
      <MenuItem name="6"
        ><Icon type="ivu-icon ivu-icon-md-person-add" /> 通知信息</MenuItem>
      <MenuItem name="7"
        ><Icon type="ivu-icon ivu-icon-md-book" /> 订单管理</MenuItem>
      <MenuItem name="8"
        ><Icon type="ivu-icon ivu-icon-md-settings" /> 商品信息</MenuItem
      >
      <!-- <MenuItem name="9"
        ><Icon type="ivu-icon ivu-icon-md-notifications" /> 通知公告</MenuItem
      >
      <MenuItem name="10"
        ><Icon type="ivu-icon ivu-icon-md-clipboard" /> 日志管理</MenuItem
      > -->
    </Menu>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  data() {
    return {
      formItem: {
        date: "",
      },
      columns: [
        {
          type: "selection",
          width: 60,
          align: "center",
        },
        {
          title: "用户编号",
          key: "id",
        },
        {
          title: "用户名称",
          key: "name",
        },
        {
          title: "Age",
          key: "age",
        },
        {
          title: "Address",
          key: "address",
        },
        {
          title: "Date",
          key: "date",
        },
      ],
      data: [
        {
          name: "John Brown",
          age: 18,
          address: "New York No. 1 Lake Park",
          date: "2016-10-03",
          id: 1,
        },
        {
          name: "Jim Green",
          age: 24,
          address: "London No. 1 Lake Park",
          date: "2016-10-01",
          id: 2,
        },
        {
          name: "Joe Black",
          age: 30,
          address: "Sydney No. 1 Lake Park",
          date: "2016-10-02",
          id: 3,
        },
        {
          name: "Jon Snow",
          age: 26,
          address: "Ottawa No. 2 Lake Park",
          date: "2016-10-04",
          id: 4,
        },
      ],
    };
  },
  methods: {
    ye(selection) {
      console.log(selection);
      if (selection == 1) {
        this.$router.push("/system/user");
        this.$store.commit("addrouterMenuItem",{
        name:"用户列表",
        path:"/system/user"
      })
      }
      if (selection == 2) {
        this.$router.push("/system/rol");
        this.$store.commit("addrouterMenuItem",{
        name:"角色管理",
        path:"/system/rol"
      })
      }
      if (selection == 3) {
        this.$router.push("/system/menu");
        this.$store.commit("addrouterMenuItem",{
        name:"商品信息",
        path:"/system/menu"
      })
      }
      if (selection == 4) {
        this.$router.push("/system/payOrderList");
        this.$store.commit("addrouterMenuItem",{
        name:"资金流水",
        path:"/system/payOrderList"
      })
      }
      if (selection == 5) {
        this.$router.push("/system/couponList");
        this.$store.commit("addrouterMenuItem",{
        name:"优惠卷",
        path:"/system/couponList"
      })
      }
      if (selection == 6) {
        this.$router.push("/system/Notice");
        this.$store.commit("addrouterMenuItem",{
        name:"通知信息",
        path:"/system/Notice"
      })
      }
      if (selection == 7) {
        this.$router.push("/system/orderList");
        this.$store.commit("addrouterMenuItem",{
        name:"订单管理",
        path:"/system/orderList"
      })
      }
      if (selection == 8) {
        this.$router.push("/system/goodsList");
        this.$store.commit("addrouterMenuItem",{
        name:"商品信息",
        path:"/system/goodsList"
      })
      }
    },
    handleSelectAll(status) {
      this.$refs.selection.selectAll(status);
    },
  },
};
</script>
<style scoped>
.but button {
  border: none;
  margin-left: 10px;
}
.but1 button {
  margin-left: 10px;
  color: rgb(74, 138, 233);
  border: rgb(74, 138, 233) 1px solid;
}
.ul3 li {
  padding-left: 40px;
  display: inline;
}
</style>
